<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JS 的三种使用方式</title>
    <script src="main.js"></script>
</head>

<body>

    <head>
        <h1>js的三种用法</h1>
    </head>
    <main>
        <ol>
            <li>外部引用</li>
            <li>内部脚本</li>
            <li>内嵌脚本</li>
        </ol>
    </main>
    <p onclick="javascript:alert('Hello!')";>学习JS基础。</p>
    <script>
        const b = 32;
        const c = 64;
        var message = 'a这是来自变量的信息';
        console.log(message,b);
        console.log(message + b);
        console.log(b + c);

        if (b==c) {
            console.log('相等'); 
        }
        else {
            console.log('不相等'); 
        }
           
        var category = "true";
        switch (category) {
            case "rumer":
            console.log('这是一个谣言');  
                break;
            case "true":
            console.log('确有此事');  
                break;
            default:
                break;
        }

        for (let index = 0; index <= 9; index++) {
            console.log(index);  
            
        }

        var i = 0;
        while (i ==0) {
            console.log(i);  
            i++;
        }

        function say(message){
            console.log(message);  
        }
        say("hello");
        say("bye");
        
        function score(url) {
            return 90;
        }
        console.log(score());
        var d = "true";
        var e = true;
        console.log(d,e,typeof d,typeof e);
        var f;
        console.log(f,typeof f);
        console.log(b,typeof b);
        console.log(typeof c.toString());
        console.log(message.toUpperCase());
        d = "2";
        console.log(typeof Boolean(d),Boolean(d));

    </script>
    <script src='demo.js'></script>

</body>

</html>